package etes;

public class Order {

	private String Instrument;
	private String orderDate;
	private String orderTime;
	private String RecordType;
	private double Price;
	private Integer Volume;
	private Integer UndisclosedVolume;
	private double Value;
	private String Qualifiers;
	private Integer TransID;
	private String BidID;
	private String AskID;
	private String BidAsk;
	private String EntryTime;
	private double OldPrice;
	private Integer OldVolume;
	private Integer BuyerBrokerID;
	private Integer SellerBrokerID;
	private Integer orderPriority;
	
	public void printOrder() {
		System.out.print("Instrument:" + this.Instrument);
		System.out.print(", Date:" + this.orderDate);
		System.out.print(", Time:" + this.orderTime);
		System.out.print(", RT:" + this.RecordType);
		System.out.print(", Price:" + this.Price);
		System.out.print(", Vol:" + this.Volume);
		System.out.print(", UDC Vol:" + this.UndisclosedVolume);
		System.out.print(", Value:" + this.Value);
		System.out.print(", Qualifiers:" + this.Qualifiers);
		System.out.print(", TransID:" + this.TransID);
		System.out.print(", BidID:" + this.BidID);
		System.out.print(", AskID:" + this.AskID);
		System.out.print(", Bid/Ask:" + this.BidAsk);
		System.out.print(", Entry Time:" + this.EntryTime);
		System.out.print(", Old Price:" + this.OldPrice);
		System.out.print(", Old Volume:" + this.OldVolume);
		System.out.print(", Buyer Broker:" + this.BuyerBrokerID);
		System.out.print(", Seller broker:" + this.SellerBrokerID);
		System.out.println(", Priority:" + this.orderPriority);
	}
	
	public void quickPrintOrder() {
		if (this.getBidAsk().equals("B"))
			System.out.print(rightPad(this.BidID, 21) + " | " + leftPad(String.valueOf(this.Volume), 10) + " | " + leftPad(String.valueOf(this.Price), 10));
		else
			System.out.print(leftPad(String.valueOf(this.Price), 10) + " | " + leftPad(String.valueOf(this.Volume), 10) + " | " + rightPad(this.AskID, 21));
	}
	
	public static String leftPad(String s, int width) {
        return String.format("%" + width + "s", s).replace(' ', ' ');
    }

    public static String rightPad(String s, int width) {
        return String.format("%-" + width + "s", s).replace(' ', ' ');
    }
	
	public String getInstrument() {
		return Instrument;
	}
	public void setInstrument(String instrument) {
		Instrument = instrument;
	}
	public String getOrderDate() {
		return orderDate;
	}
	public void setOrderDate(String orderDate) {
		this.orderDate = orderDate;
	}
	public String getOrderTime() {
		return orderTime;
	}
	public void setOrderTime(String orderTime) {
		this.orderTime = orderTime;
	}
	public String getRecordType() {
		return RecordType;
	}
	public void setRecordType(String recordType) {
		RecordType = recordType;
	}
	public double getPrice() {
		return Price;
	}
	public void setPrice(double price) {
		Price = price;
	}
	public Integer getVolume() {
		return Volume;
	}
	public void setVolume(Integer volume) {
		Volume = volume;
	}
	public Integer getUndisclosedVolume() {
		return UndisclosedVolume;
	}
	public void setUndisclosedVolume(Integer undisclosedVolume) {
		UndisclosedVolume = undisclosedVolume;
	}
	public double getValue() {
		return Value;
	}
	public void setValue(double value) {
		Value = value;
	}
	public String getQualifiers() {
		return Qualifiers;
	}
	public void setQualifiers(String qualifiers) {
		Qualifiers = qualifiers;
	}
	public Integer getTransID() {
		return TransID;
	}
	public void setTransID(Integer transID) {
		TransID = transID;
	}
	public String getBidID() {
		return BidID;
	}
	public void setBidID(String bidID) {
		BidID = bidID;
	}
	public String getAskID() {
		return AskID;
	}
	public void setAskID(String askID) {
		AskID = askID;
	}
	public String getBidAsk() {
		return BidAsk;
	}
	public void setBidAsk(String bidAsk) {
		BidAsk = bidAsk;
	}
	public String getEntryTime() {
		return EntryTime;
	}
	public void setEntryTime(String entryTime) {
		EntryTime = entryTime;
	}
	public double getOldPrice() {
		return OldPrice;
	}
	public void setOldPrice(double oldPrice) {
		OldPrice = oldPrice;
	}
	public Integer getOldVolume() {
		return OldVolume;
	}
	public void setOldVolume(Integer oldVolume) {
		OldVolume = oldVolume;
	}
	public Integer getBuyerBrokerID() {
		return BuyerBrokerID;
	}
	public void setBuyerBrokerID(Integer buyerBrokerID) {
		BuyerBrokerID = buyerBrokerID;
	}
	public Integer getSellerBrokerID() {
		return SellerBrokerID;
	}
	public void setSellerBrokerID(Integer sellerBrokerID) {
		SellerBrokerID = sellerBrokerID;
	}
	public Integer getOrderPriority() {
		return orderPriority;
	}
	public void setOrderPriority(Integer orderPriority) {
		this.orderPriority = orderPriority;
	}	
	
	
}
